//
//  HelpObject.h
//  MobileLier
//
//  Created by caoshuaikun on 16/4/13.
//  Copyright © 2016年 com.Mobilizer.name. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>

typedef void(^Action)(UIAlertAction *alterAction);

@interface HelpObject : NSObject<CLLocationManagerDelegate>

//确定按钮
@property (nonatomic,copy) Action alterAction;
//拍照
@property (nonatomic,copy) Action alterActionP;
/**
 *  点击取消按钮
 */
//@property (nonatomic,copy) Action alterActionC;
//相册中选择
//@property (nonatomic,copy) Action alterActionX;

//点击确认
@property (nonatomic,copy) Action alterActionA;

+ (HelpObject *)manager;

//文件压缩
- (UIImage *) scaleFromImage: (UIImage *) image toSize: (CGSize) size;

+ (BOOL)judgeSameArray:(NSArray *)arrayOne WithArray:(NSArray *)arrayTwo;//判断两个数组元素是否相同

//获取当前是什么网络
- (int)getnate;

//获取当前的东西
- (NSDateComponents *)getNSDateComponents;

//获取字体gaodu 宽度
-(CGFloat)textHeightFromString:(NSString *)textStr width:(CGFloat)width fontSize:(CGFloat)size space:(CGFloat)space;

//图片转化为data
+ (NSData *)chengeData:(UIImage *)image;

//保持原来的长宽比，生成一个
- (UIImage *)thumbnailWithImageWithoutScale:(UIImage *)image size:(CGSize)asize;

- (UILabel *)labelActionChenge:(NSString *)labelText myView:(UIView *)myView;
//数组转换为数组字符串
+ (NSString *)arrayChengeToString:(NSMutableArray *)OriginalArray;

//根据url获取图片
+ (UIImage *)getUrlImage:(NSURL *)url;
//判断字符串是不是空
+ (BOOL)isBlankString:(NSString *)string;
//压缩后的图片数组
+ (NSMutableArray *)imageCompressMutableArray:(NSMutableArray *)orinalImageMutableArray;
//第三种压缩图片的方法
+ (UIImage *) imageCompressForWidth:(UIImage *)sourceImage targetWidth:(CGFloat)defineWidth;
//判断任意是否为空
+ (BOOL)isNull:(id)object;

//图片压缩指定大小
+ (UIImage *)PhotoCompressedToSpecifiedSize:(UIImage *)orignalPicture;

+(NSString *)getUrlStringFromString:(NSString *)urlStr;

/**
 *  获取本地数据
 */
+ (NSString *)df:(NSString *)getDFMessge;

/**
 *  判断是不是手机号
 */
+ (BOOL)isMobileNumber:(NSString *)mobileNum;

/**
 *  获取文字尺寸
 */
- (CGSize)textRectFromString:(NSString *)textStr size:(CGSize)size font:(float)textFont;

/**
 *  截取字符串 3;3;3
 */
+ (NSArray *)getStrFrom:(NSString *)text to:(NSString *)flag;

/**
 *  存储本地数据
 */
+ (void)saveMsg:(NSString *)msg key:(NSString *)key;

//归档接档存储数据----
//写入沙盒
+ (void)writeToDocument:(id)file strPath:(NSString *)strPath;
//读取沙盒内容
+ (id)getDocumentDicStrPath:(NSString *)strPath;
//汉字转拼音
- (NSString *) phonetic:(NSString*)sourceString;

- (UILabel *)labelActionChange:(NSString *)labelText myView:(UIView *)myView;

//null转string
+ (NSString *)changeNull:(id)object;

/**
 ** lineView:	   需要绘制成虚线的view
 ** lineLength:	 虚线的宽度
 ** lineSpacing:	虚线的间距
 ** lineColor:	  虚线的颜色
 **/
+ (void)drawDashLine:(UIView *)lineView lineLength:(int)lineLength lineSpacing:(int)lineSpacing lineColor:(UIColor *)lineColor;

//正则判断身份证
- (BOOL)judgeIdentityStringValid:(NSString *)identityString;


+ (void)userDefaultsSet:(NSString *)key value:(NSString *)value;

- (NSString*)iphoneType;

+ (NSString *)getDeviceId;

+ (UINavigationController *)getCurrentNav;//获取当前控制器;
+ (UIViewController *)getPresentedViewController;

//获取Window当前显示的ViewController
+ (UIViewController*)getCurrentViewController;

+(UIImage *)colorizeImage:(UIImage *)baseImage withColor:(UIColor *)theColor;
@end
